/*
 * File Name: StartConnectionAction.java
 */

package co.edu.uniandes.intercon.client.action;

import java.util.Map;

import javax.swing.JFrame;

import co.edu.uniandes.intercon.client.gui.add.AbstractApplicationAddition;
import co.edu.uniandes.intercon.client.gui.add.ApplicationAdditionWindow;

/**
 * Action used to start the communication to the system
 * 
 * @author Fabian Gutierrez [fagossa@gmail.com]
 */
public class NewAppAction extends AbstractBaseGUIAction {

    private AbstractApplicationAddition dialog;
	
	/**
	 * @see AbstractBaseGUIAction#execute(Map)
	 */
	public Object execute(Map<String, Object> params) throws RuntimeException {
		 JFrame window = (JFrame) params.get("window");
	        if (dialog==null) {
	            dialog = new ApplicationAdditionWindow(window);
	            dialog.setModal(true);
	        }
	        dialog.setVisible(true);

		return null;
	}

}
